


        var slidePrevent = false;
        var headSwpInd;
        var step = 89;
        var workSwiper = new Swiper('.workSwiper',{
            loop:true,
        })
        var picSwiper = new Swiper('.picSwiper .swiper-container',{
            autoplay: {
                disableOnInteraction: false,
            },
            effect : 'fade',
            fadeEffect: {
                crossFade: true,
            },
            speed:800,
            pagination: {
                el: '.picSwiper .swiper-pagination',
                clickable :true
            },
        })
        
        $(document).ready(function(){
            $('main .headSwiper .contn .palace p').eq(0).clone().appendTo('main .headSwiper .contn .palace');
            $('main .headSwiper .contn .palace p:last-child').removeClass('active');
            $('main .headSwiper .contn .control .val .all').text($('main .headSwiper .contn .palace p').length - 1);
            $('main .headSwiper .contn .control').click(function(){
                if(slidePrevent) return false;
                var length = $('main .headSwiper .contn .palace p').length;
                headSwpInd = $('main .headSwiper .contn .palace .active').next().index();
                $('main .headSwiper .contn .palace p').removeClass('active');
                if(headSwpInd == length - 1){
                    slidePrevent = true;
                    setTimeout(function(){
                        $('main .headSwiper .contn .palace').addClass('noTsn');
                        $('main .headSwiper .contn .palace').css('transform','translateX(0px)');
                    },800)
                    setTimeout(function(){
                        $('main .headSwiper .contn .palace').removeClass('noTsn');
                        slidePrevent = false;
                    },810)
                    $('main .headSwiper .contn .control .val .curnt').text(1);
                    $('main .headSwiper .contn .palace p').eq(0).addClass('active');
                }else{
                    $('main .headSwiper .contn .control .val .curnt').text(headSwpInd + 1);
                    $('main .headSwiper .contn .palace p').eq(headSwpInd).addClass('active');
                }
                var lft = step * headSwpInd;
                $('main .headSwiper .contn .palace')[0].style.transform = 'translateX(-' + lft + '%)';
            })

            watchBrowse = setInterval(function(){
                if(window.innerWidth < 768 && step != 83){
                    step = 83;
                    $('main .headSwiper .contn .palace')[0].style.transform = 'translateX(-' + (step * headSwpInd) + '%)';
                }else if(window.innerWidth >= 768 && step != 89){
                    step = 89;
                    $('main .headSwiper .contn .palace')[0].style.transform = 'translateX(-' + (step * headSwpInd) + '%)';
                }
            },10)

            $('main .ognztn .fluid .related .pic .btn').click(function(){
                console.log($(this).parents('.item').index());
                if($(this)[0].className.indexOf('prev') >= 0){
                    if(workSwiper.length){
                        workSwiper[$(this).parents('.item').index()].slidePrev();
                    }else{
                        workSwiper.slidePrev();
                    }
                }else{
                    if(workSwiper.length){
                        workSwiper[$(this).parents('.item').index()].slideNext();
                    }else{
                        workSwiper.slideNext();
                    }
                }
            })

            for(var p = 0;p < $('main .details .picSwiper').length;p++){
                $('main .details .picSwiper')[p].ind = p;
            }
            $('main .details .pagination p').click(function(){
                if($(this)[0].className.indexOf('active') >= 0) return false;
                var ind = $(this).index();
                var dadInd = $(this).parents('.picSwiper')[0].ind;
                $(this).parent().find('p').removeClass('active');
                $(this).addClass('active');
                if(picSwiper.length){
                    picSwiper[dadInd].slideTo(ind);
                }else{
                    picSwiper.slideTo(ind);
                }
            })

            
        })